home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / FGL304D.ZIP;1 / EXBAS.ARJ / FGDOC / EXAMPLES / BASIC / 06-01.BAS < prev    next >
Encoding:
BASIC Source File  |  1994-01-24  |  870 b   |  47 lines

  1. REM $INCLUDE: 'fastgraf.bi'
  2.  
  3. DEFINT A-Z
  4.  
  5. OldMode = FGgetmode
  6. NewMode = FGautomode
  7. FGsetmode NewMode
  8.  
  9. IF NewMode = 4 THEN
  10.    MaxColor = 3
  11. ELSEIF NewMode = 11 OR NewMode = 17 THEN
  12.    MaxColor = 1
  13. ELSEIF NewMode = 19 THEN
  14.    MaxColor = 255
  15. ELSE
  16.    MaxColor = 15
  17. END IF
  18.  
  19. Left = 100
  20. MaxX = FGgetmaxx - 1
  21. MaxY = FGgetmaxy - 1
  22.  
  23. WHILE Left > 0
  24.  
  25.    X = (RND * 32767) MOD MaxX + 1
  26.    Y = (RND * 32767) MOD MaxY + 1
  27.  
  28.    Area = FGgetpixel(X-1,Y-1) + FGgetpixel(X,Y-1) + FGgetpixel(X+1,Y-1) _
  29.         + FGgetpixel(X-1,Y)   + FGgetpixel(X,Y)   + FGgetpixel(X+1,Y) _
  30.         + FGgetpixel(X-1,Y+1) + FGgetpixel(X,Y+1) + FGgetpixel(X+1,Y+1)
  31.  
  32.    IF Area = 0 THEN
  33.       PointColor = (RND * 32767) MOD MaxColor + 1
  34.       FGsetcolor PointColor
  35.       FGpoint X, Y
  36.       Left = Left - 1
  37.    END IF
  38.  
  39. WEND
  40.  
  41. FGwaitkey
  42.  
  43. FGsetmode OldMode
  44. FGreset
  45.  
  46. END
  47.